package com.shelpe.services.sinbadgateway.client;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.Data;
import rx.Observable;

@FeignClient(name="${feign.algorithmserver.name}", url="${feign.algorithmserver.url}")
@RequestMapping("/algorithmservice/users/{user_id}")
public interface AutoProductQueueClient {

	@RequestMapping(path = "/autoProductQueues/@start", method = RequestMethod.GET)
	Observable<AutoDrivingDto> startAutoDrive(@RequestParam("campaign_id") long campaignID,
			@RequestParam("product_id") long productID);

	@Data
	public static class AutoDrivingDto{
		private boolean success;

		@JsonProperty("campaign_id")
		private long campaignID;
		@JsonProperty("product_id")
		private long productID;
		@JsonProperty("default_price")
		private int defaultPrice;
	}
}